#include<bits/stdc++.h>
using namespace std;

string a;
vector<string>arr;
void dfs(string s,int begin,int len,int times) {
	if (times > 3) { return; }
	if (begin + len > a.size()) { return; }
	string temp;
	for (int i = begin; i < begin + len; i++) {
		temp += a[i];
	}
	if (stoi(temp) > 255) { return; }
	for (int i = begin; i < begin + len; i++) {
		s += a[i];
	}
	if (times == 3 && s.size() - 3 == a.size()) {
		arr.push_back(s);
		return;
	}
	s += ".";
	dfs(s, begin + len, 1, times + 1);
	dfs(s, begin + len, 2, times + 1);
	dfs(s, begin + len, 3, times + 1);
}
int main() {
	cout << "请输入你的IP地址：" << endl;
	cin >> a;
	string temp;
	dfs(temp, 0, 1, 0);
	dfs(temp, 0, 2, 0);
	dfs(temp, 0, 3, 0);
	cout << "可以转换的IP地址为：" << endl;
	for (int i = 0; i < arr.size(); i++) {
		cout << arr[i] << endl;
	}
	return 0;
}
